<div class="select-popup-container">
	<div <?php if (isset($id)) : ?>id="sw_<?php echo $prefix . '_' . $id ?>_wrap"<?php endif; ?> class="selected-status status-<?php if ($suffix) { echo $suffix . '-'; } ?><?php echo strtolower($status) ?> <?php if (isset($id)) : ?>cm-combo-on cm-combination<?php endif; ?>">
		<a <?php if (isset($id)) : ?>class="cm-combo-on <?php if ( !isset($popup_disabled) || !$popup_disabled ) : ?> cm-combination <?php endif; ?>"<?php endif; ?>>
			<?php if ( !empty($items_status) ) {
				if ( isset($items_status[$status]) ) {
					echo $items_status[$status];
				}
			} else {
				switch ($status) {
					case 'A':
						echo t('Active');
						break;
					case 'H':
						echo t('Hidden');
						break;
					case 'D':
						echo t('Disabled');
						break;
					case 'P':
						echo t('Pending');
						break;
					case 'S':
						echo t('Success');
						break;
					case 'F':
						echo t('Fail');
				}
			} ?>
		</a>
	</div>
	<?php if ( isset($id) ) : ?>
	<div id="<?php echo $prefix . '_' . $id ?>_wrap" class="popup-tools cm-popup-box hidden">
		<img src="<?php echo bu() ?>images/icons/icon_close.gif" width="13" height="13" border="0" alt="" class="close-icon no-margin cm-popup-switch" />
		<ul class="cm-select-list">
			<?php if ( !empty($items_status) ) {
				foreach ($items_status as $st => $label) {
					echo '<li>';
					echo CHtml::link($label, array(
						"/{$update_controller}/{$update_action}",
						'id' => $id,
						'table' => isset($table) ? $table : '',
						'id_name' => isset($id_name) ? $id_name : '',
						'status' => $st,
					), array(
						'onclick' => "return fn_check_object_status(this, '$st');",
						'name' => 'update_object_status_callback',
						'class' => "status-link-$st " . ($status == $st ? 'cm-active' : 'cm-ajax'),
						'rev' => (isset($status_rev) ? $status_rev : ''),

					));
					echo '</li>';
				}
			} else {
				echo '<li>';
				echo CHtml::link(t('Active'), array(
					"/{$update_controller}/{$update_action}",
					'id' => $id,
					'table' => isset($table) ? $table : '',
						'id_name' => isset($id_name) ? $id_name : '',
					'status' => 'A',
				), array(
					'encode' => false,
					'onclick' => "return fn_check_object_status(this, 'a');",
					'name' => 'update_object_status_callback',
					'class' => 'status-link-a ' . ($status == 'A' ? 'cm-active' : 'cm-ajax'),
					'rev' => (isset($status_rev) ? $status_rev : ''),
					
				));
				echo '</li>';

				echo '<li>';
				echo CHtml::link(t('Disabled'), array(
					"/{$update_controller}/{$update_action}",
					'id' => $id,
					'table' => isset($table) ? $table : '',
						'id_name' => isset($id_name) ? $id_name : '',
					'status' => 'D',
				), array(
					'encode' => false,
					'onclick' => "return fn_check_object_status(this, 'd');",
					'name' => 'update_object_status_callback',
					'class' => 'status-link-d ' . ($status == 'D' ? 'cm-active' : 'cm-ajax'),
					'rev' => (isset($status_rev) ? $status_rev : ''),

				));
				echo '</li>';

				if ( isset($hidden) && $hidden ) {
					echo '<li>';
					echo CHtml::link(t('Hidden'), array(
						"/{$update_controller}/{$update_action}",
						'id' => $id,
						'table' => $table,
						'id_name' => $id_name,
						'status' => 'H',
					), array(
						'encode' => false,
						'onclick' => "return fn_check_object_status(this, 'h');",
						'name' => 'update_object_status_callback',
						'class' => 'status-link-h ' . ($status == 'H' ? 'cm-active' : 'cm-ajax'),
						'rev' => (isset($status_rev) ? $status_rev : ''),

					));
					echo '</li>';
				}
			} ?>
		</ul>
	</div>
	<?php endif; ?>
</div>